package com.thirteengroup.casemg.service.impl;

import com.thirteengroup.casemg.domain.Department;
import com.thirteengroup.casemg.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class DepartmentService implements IDepartmentService {

    @Autowired
    private com.thirteengroup.casemg.Mapper.departmentMapper departmentMapper;
    @Override
    public List<Department> queryAllDepartment() {
        List<Department> list=new ArrayList<>();
        list=departmentMapper.selectAll();
        return list;
    }

    @Override
    public void deleteById(Long id) {
        departmentMapper.deleteById(id);
    }

    @Override
    public Department slectOne(Long id) {
        Department dept=departmentMapper.selectOne(id);
        return dept;
    }

    @Override
    public void insertDept(Department dept) {
        departmentMapper.insert(dept);
    }

    @Override
    public void updateDept(Department dept) {
        departmentMapper.update(dept);
    }

    @Override
    public void selectOneByName(String name) {
        departmentMapper.selectOneByName(name);
    }
}
